package com.hh.vietnameseproject.logic.network

import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.*

interface LoginService {

    //获取手机验证码
    @POST("phoneCode/2")
    @FormUrlEncoded
    fun getPhoneCode(@Field("phone") phone:String,@Field("checkcode") checkcode:String): Call<ResponseBody>


    //获取静态验证码
    @GET("checkCode")
    fun getCheckCode():Call<ResponseBody>


    //手机验证码登录
    @POST("login/2")
    @FormUrlEncoded
    fun login(@Field("phone") phone:String,@Field("phonecode")phonecode:String):Call<ResponseBody>

    //手机密码登录
    @POST("login/1")
    @FormUrlEncoded
    fun loginPwd(@Field("phone") phone:String,@Field("password")pwd:String,@Field("checkcode") checkcode:String):Call<ResponseBody>

    //获取注册的手机验证码
    @POST("phoneCode/1")
    @FormUrlEncoded
    fun getRegistPhoneCode(@Field("phone") phone:String,@Field("checkcode") checkcode:String): Call<ResponseBody>

    //注册手机号
    @POST("register")
    @FormUrlEncoded
    fun registPhone(@Field("phone") phone:String,@Field("phonecode") phonecode:String,@Field("username")name:String): Call<ResponseBody>

    //忘记密码
    @POST("forgetPassword")
    @FormUrlEncoded
    fun forgetCode(@Field("phone") phone:String,@Field("phonecode") phonecode:String,@Field("password")pwd:String):Call<ResponseBody>

    //添加密码
    @POST("addPassword")
    @FormUrlEncoded
    fun addPassword(@Field("password")password:String):Call<ResponseBody>

    //修改密码
    @POST("updatePassword")
    @FormUrlEncoded
    fun changePassword(@Field("oldpassword")old:String,@Field("newpassword")new:String):Call<ResponseBody>
}